package com.espirit.builder.base;

import org.springframework.stereotype.Component;

import com.espirit.eap.manager.Department;
import com.espirit.eap.manager.ModelBuilderSupport;
import com.espirit.eap.pagelayout.ModelField;
@Component
public class DepartmentBuilder extends ModelBuilderSupport {
//	private static final String FIELD_CODE="code";
	private static final String FIELD_NAME="name";
	@Override
	public boolean init() {
		return super.setClass(Department.class, "Department", "部门") ;
	}
	@Override
	public void buildFields() {
//		addModelField(FIELD_CODE, "Code", "代码");
		addModelField(FIELD_NAME, "Name", "名称");
	}
	@Override
	public void prepareLayoutElements() {
		ModelField mfName = getModelField(FIELD_NAME);
//		ModelField mfCode = getModelField(FIELD_CODE);
		
		addListField(mfName);
		addDetailField(mfName);
//		setRequired(FIELD_CODE);
		setRequired(FIELD_NAME);
		
		super.prepareLayoutElements();
	}
	
}
